SET COLOR TO BG+/B
@ 10,1 clea to 23,78
DO BOXT WITH 7,43,"PATIENT CODE : "+KODEPAT,'GR+','B',.F.,.T.
DO BOXT WITH 10,1,"SURNAME : "+PNAME+"FIRST NAME : "+PFNAME+"MID. INITIAL : "+MINIT,'GR+','B',.F.,.F.
DO BOXT WITH 12,1,"DATE OF BIRTH : "+DTOC(PATDOB)+"  NATIONALITY : "+PATNAT+" SEX : "+PATSEX,'GR+','B',.F.,.F.
IF CMS .AND. INSVAL>DATE() .AND. .NOT. AEAM .AND. .NOT. AEAHL
   DO BOXT WITH 14,1,"CASHLESS MEDICAL SERVICE (CMS) VALID TILL : "+DTOC(INSVAL),'GR+*','B',.F.,.F.
ENDIF
IF AEAHL .AND. .NOT. AEAM  .AND. .NOT. CMS
   IF HL .AND. HLST>DATE()
      DO BOXT WITH 14,1,"HEALTHLINE EFFECTIVE : "+DTOC(HLST)+'  CARD #. : '+pat_filcod+' '+pat_codcrp+" "+pat_codcre+" "+pat_coddat+" "+PAT_CODTYP,'GR+','B',.F.,.F.
   ENDIF
   IF HL .AND. HLEND>DATE() .AND. HLST<=DATE()
      DO BOXT WITH 14,1,"HEALTHLINE VALID TILL : "+DTOC(HLEND)+'  CARD #. : '+pat_filcod+' '+pat_codcrp+" "+pat_codcre+" "+pat_coddat+" "+PAT_CODTYP ,'GR+*','B',.F.,.F.
   ENDIF
ENDIF
IF CMS .AND. INSVAL>DATE()
   DO BOXT WITH 14,1,"CASHLESS MEDICAL SERVICE (CMS) VALID TILL : "+DTOC(INSVAL),'GR+*','B',.F.,.F.
ENDIF
IF PER
   DO BOXT WITH 14,1,"EMPLOYEE STATUS, please check the Medical Card",'GR+*','B',.F.,.F.
ENDIF
IF FAM
   DO BOXT WITH 14,1,"DEPENDANT STATUS, please check the Medical Card",'GR+*','B',.F.,.F.
ENDIF
IF AEAM .AND. .NOT. CMS .AND. .NOT. AEAHL
*   DO BOXT WITH 14,1,"MEMBERSHIP OF "+ALLTRIM(AEAPRG),'GR+*','B',.F.,.F.
   DO BOXT WITH 14,1,"MEMBERSHIP OF "+ALLTRIM(AEAPRG)+ " VALID TILL : "+DTOC(AEADAT),'GR+*','B',.F.,.F.
ENDIF
IF AEAM  .AND. AEAHL .AND. AEAPRG='CORPORATE MEDIC'
*   DO BOXT WITH 14,1,"MEMBERSHIP OF "+ALLTRIM(AEAPRG),'GR+*','B',.F.,.F.
   DO BOXT WITH 14,1,"MEMBERSHIP OF "+ALLTRIM(AEAPRG)+ " VALID TILL : "+DTOC(AEADAT),'GR+*','B',.F.,.F.
ENDIF
IF FAM
   DO BOXT WITH 14,1,"DEPENDANT STATUS, please check the Medical Card",'GR+*','B',.F.,.F.
ENDIF
SET COLO TO BG+/B,W+/N
if cocoD=space(4) .or. cocoD='0000'
   DO BOXT WITH 16,1,"NO COMPANY recorded for this PATIENT",'GR+','B',.F.,.F.
ELSE
   coNAM=space(48)
   sele 2
   SET EXCLU OFF
   USE &DR&F2 INDE &DR&F2
   seek cocoD
   If EOF()
      DO BOXT WITH 16,1,"NO COMPANY recorded for this PATIENT",'GR+','B',.F.,.F.
   ELSE
      conam=comp_name
      sele 1
      DO BOXT WITH 16,1,"COMPANY : "+CONAM+COCOD,'GR+','B',.F.,.F.
   ENDIF
   SELE 1
ENDIF
DO BOXT WITH 18,1,"PLEASE CHECK CAREFULLY THE PATIENT'S IDENTITY",'GR+','B',.F.,.F.
DO BOX2 WITH 21,3,"DO YOU WANT TO : ","CONFIRM","CANCEL",'GR+','RB','GR+','R',PIL4,.F.,.T.
IF PIL4=1
   TRUEPAT=.T.
ENDIF
return